-
Notifications
You must be signed in to change notification settings - Fork 369
Adds spo tenant site get command. Closes #6654
#7003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
spo site alert get command. Closes #6654spo tenant site get command. Closes #6654
6686856 to
4f4bf90
Compare
MartinM85
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @MathijsVerbeeck
I have a couple of small comments, nothing major.
|
|
||
| const optionsSchema = globalOptionsZod | ||
| .extend({ | ||
| id: zod.alias('i', z.string().refine(id => validation.isValidGuid(id), { message: 'Specify a valid GUID' }).optional()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| id: zod.alias('i', z.string().refine(id => validation.isValidGuid(id), { message: 'Specify a valid GUID' }).optional()), | |
| id: zod.alias('i', z.string().uuid().optional()), |
|
|
||
| export default new SpoTenantSiteGetCommand(); | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }); | ||
|
|
||
| it('fails validation when specifying none of id, title, url', async () => { | ||
| const commandOptionsSchema = commandInfo.command.getSchemaToParse()!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define the commandOptionsSchema only once in the spec file.
let commandOptionsSchema: z.ZodTypeAny;
...
before(() => {
...
commandOptionsSchema = commandInfo.command.getSchemaToParse()!;
});
|
|
||
| sinon.stub(spo, 'getSiteAdminPropertiesByUrl').resolves(siteResponse); | ||
|
|
||
| await command.action(logger, { options: { title: 'Marketing', verbose: true } }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please parse the command options.
| await command.action(logger, { options: { title: 'Marketing', verbose: true } }); | |
| await command.action(logger, { options: commandOptionsSchema.parse({ title: 'Marketing', verbose: true }) }); |
Same for other tests.
Closes #6654